/**
  ******************************************************************************
  * @file   
  * @brief  
  ******************************************************************************
  * @note

 */

#ifndef __PID_H
#define __PID_H

/* Includes ------------------------------------------------------------------*/
#include "integrator_Differentiator.h"
//#include <stdlib.h>
#include "System_Config.h"
//#include "System_Config.h"
/* Definitions ---------------------------------------------------------*/
typedef struct{
	float output_value;
	float input_err;
	float PID_P;
	float PID_I;
	float PID_D;
	float output_uplimit;
	float output_downlimit;
	integrator_op *integ;
	differentiator_op *diff;
}PID_OP;

/* Private variables ---------------------------------------------------------*/

/* Global variables ---------------------------------------------------------*/

/*Functions------------------------------------------------------------------*/
void PID_init(PID_OP *PID,float step_h,float rate_r,float parameter_p,float parameter_i,float parameter_d,float i_uplimit,float i_downlimit,float uplimit,float downlimit);
void PID_control(PID_OP *PID,float err);
/* Exported function declarations --------------------------------------------*/

#endif
